﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class ZHCX_KHSFMXB : System.Web.UI.Page
{
  protected void Page_Load(object sender, EventArgs e)
  {
    if (!Page.IsPostBack)
    {
      if (!ProjectPrivate.GetQX("29"))
      {
        Server.Transfer("~\\blank.aspx");
      }
      DataSet ds = CBSJ.GetYear();
      CommonUse.BindDDL(ds, "year", "year", DateTime.Now.Year.ToString(), ddlYear);
      InitData();
      hlTX.NavigateUrl = "KHSFMXB_TX.aspx?khid=" + CommonUse.GetID("khid");
      hlSJ.NavigateUrl = "KHSFMXB.aspx?khid=" + CommonUse.GetID("khid");
    }
  }
  protected void InitData()
  {
    string sND = ddlYear.SelectedValue;
    string sKHID = CommonUse.GetID("khid");
    if (string.IsNullOrEmpty(sND) || string.IsNullOrEmpty(sKHID))
    {
      return;
    }
    lbKHBM.Text = sKHID;
    lbKHMC.Text = KHXX.GetKHMC(sKHID);
    lbLYBZJ.Text = string.Format("{0:n}", Convert.ToDouble(YJLR.GetYJ(sKHID)));
    lbSNJZ.Text = string.Format("{0:n}", Convert.ToDouble(JFSJ.GetSNJZ(sKHID, sND)));
  }
  protected void ddlYear_SelectedIndexChanged(object sender, EventArgs e)
  {
    InitData();
  }
}